-
Notifications
You must be signed in to change notification settings - Fork 22
[Breaking Chgs] Indices, updates, model caching, etc. #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Remove references to sails for use with Waterline standalone.
Thank you for your effort.
|
Sorry, that was a silly oversight! It's a simple fix– I'll update soon. |
Should be resolved– let me know if it gives you any more issues. I expect it will not work with your current configuration, as
currently implies the key name is
using any index |
Can you add it to readme file so it would be documented? |
Do these additions seem adequate? |
I added a fix for endpoint while using a local dynamoDB and made changes to the model but I keep getting "Specified index is not part of table" for a model that does not have an index. Can you check? |
This occurs during a |
This bug should be resolved now. |
Creating a new record without specifying an id produces error: |
I see that Vogels has an autogenerating UUID type– are you expecting to use that in a certain scenario? How should your primary key attribute be configured in order to use Vogels' UUID type? Some users may want their primary key hash to be something other than a UUID. |
Yes, It is part of sails framework activated by autoPK setting http://sailsjs.org/#/documentation/concepts/ORM/model-settings.html |
Okay, here's how I added
Because |
Yes that is how it is currently working on master. |
Did that last commit make it work for you? |
Yes it does not seem to solve the problem |
It is working for me. I'll take a closer look, though. We should try to write some tests. I'm also confused, as that stack trace does not include any files in sails-dynamodb. |
[Breaking Chgs] Indices, updates, model caching, etc.
I made tons of updates here. It definitely resulted in breaking changes. But I think I've added many features and made the adapter function more naturally. If you'd rather not make such breaking changes now, that's understandable! Here's what I did:
Allow for named global secondary indices using
index: 'IndexName-hash'
andindex: 'IndexName-range'
. Similarly, you specify primary keys asprimaryKey: 'hash'
andprimaryKey: 'range'
.Allow for named local secondary indices using
index: 'secondary'
. In that case, Vogels assumes that the index name is the name of the field, which the adapter respects.Cache Vogels models instead of recreating them all the time. They live in
_vogelsReferences
. To avoid confusion, I renamed_modelReferences
to_collectionReferences
.If a table name ends in an 's' then that 's' is removed before creating the Vogels model. That allows one to create a waterline collection with identity ending in 's' and use it normally. The waterline identity can then match the table name.
I don't automatically create a primary key using
keyId
(since the name is created once explicitly for the table) or name indices usingindexPrefix
(because it seems like an unnecessary limitation).Removed the automatic creation of
updatedAt
andcreatedAt
in the adapter. Standard waterline collection configurations should be able to deal with that.find
automatically uses the most relevant index with the following precedence,update
performs updates using conditional checks, so you can use conditions other than key conditions.